package src.com.servlet;

import src.com.service.MyService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

public class GetSentenceByFre extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("UTF-8");
        resp.setContentType("text/html");
        MyService myService = new MyService();
        List<String> data = myService.getSentenceByFre();
        PrintWriter out = resp.getWriter();
        out.print(data.size()+",");
        for(int i=0;i<data.size();i++){
            out.print(data.get(i));
            out.print(",");
        }
        out.flush();
        out.close();
    }
}
